package com.liusaidh.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;
import org.springframework.validation.annotation.Validated;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Random;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "User对象：用户实体类",description = "用户实体类")
public class User {
    @ApiModelProperty(value = "id", name = "id")
    private Integer id;
    @ApiModelProperty(value = "用户名", name = "username")
    private String username;//昵称
    @ApiModelProperty(value = "密码", name = "password")
    private String password;
    @ApiModelProperty(value = "邮箱", name = "email")
    private String email;
    @ApiModelProperty(value = "年龄", name = "age")@Range(min = 1,max = 120,message = "年龄必须在1-120岁之间")
    private Integer age;
    @ApiModelProperty(value = "性别", name = "sex")
    private Character sex;
    @ApiModelProperty(value = "是否认证,1代表认证  0代表不是认证，也没有申请认证  2代表申请了认证，但是要管理员审核", name = "official")
    //     官方认证：official（1代表认证  0代表不是认证，也没有申请认证  2代表申请了认证，但是要管理员审核）
    private Integer official;//是否认证
    @ApiModelProperty(value = "会员,1代表是  0代表不是", name = "vip")
    // 会员:vip  (int类型  1代表是  0代表不是)
    private Integer vip;
    @ApiModelProperty(value = "是否注销,1代表注销 0代表没注销", name = "exist")
    private Integer exist;
    @ApiModelProperty(value = "是否禁言,1代表被禁言  0代表未被禁言", name = "ban")
    //    是否被管理员禁言：ban（1代表被禁言  0代表未被禁言）
    private Integer ban;//是否被禁止
    @ApiModelProperty(value = "头像地址", name = "avatarUrl")
    private String avatarUrl;
    @ApiModelProperty(value = "背景图片地址", name = "backgroundUrl")
    private String backgroundUrl;
    @ApiModelProperty(value = "注册时间", name = "entryDate")
    private String entryDate;
    @ApiModelProperty(value = "地址", name = "address")
    private String address;
    @ApiModelProperty(value = "标签", name = "label")
    private String label;
    @ApiModelProperty(value = "是不是管理员 1是  0不是", name = "isManager")
    private Integer isManager;



    public User(String username, String password, String email, Integer official, Integer vip, Integer exist, Integer ban, String avatarUrl, String entryDate, Integer isManager) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.official = official;
        this.vip = vip;
        this.exist = exist;
        this.ban = ban;
        this.avatarUrl = avatarUrl;
        this.entryDate = entryDate;
        this.isManager = isManager;
    }

    public User(String username, String password, String email, String entryDate) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.entryDate = entryDate;
    }

    public User(Integer id, String email, String password) {
        this.id = id;
        this.password = password;
        this.email = email;
    }

    public User(String email, String password) {
        this.password = password;
        this.email = email;
    }

    public User(Integer id,String username, Integer age, Character sex, String address,String label) {
        this.label = label;
        this.id = id;
        this.username = username;
        this.age = age;
        this.sex = sex;
        this.address = address;
    }

    public User(String email,String username, String password, Character sex, Integer age,  Integer isManager,String address) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.age = age;
        this.sex = sex;
        this.isManager = isManager;
        this.address = address;
    }
    public User(Integer id,String email,String username, Character sex, Integer age,  Integer isManager,String address) {
        this.id = id;
        this.username = username;
        this.email = email;
        this.age = age;
        this.sex = sex;
        this.isManager = isManager;
        this.address = address;
    }
}
